From: Jan Djärv Date: Sat, 8 Nov 2014 16:32:37 +0000 (+0100) Subject: Attempt to fix NS hang. Will probably cause merge conflicts. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~24^2~334 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=86b1c771e14efcc98f8fe07510a4238bf94ced7b;p=emacs.git Attempt to fix NS hang. Will probably cause merge conflicts. * nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA. (run): Ditto. Only use non-system event loop if OSX version is exactly 10.9. Fixes: debbugs:18993 --- diff --git a/src/ChangeLog b/src/ChangeLog index 81e2a27c200..1544df0da8c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-11-08 Jan Djärv + + * nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA. + (run): Ditto. Only use non-system event loop if OSX version is + exactly 10.9 (Bug#18993). + 2014-11-07 Michael Albinus * callproc.c (encode_current_directory): Support handling of file diff --git a/src/nsterm.h b/src/nsterm.h index eb2165a89d3..cc5ec0d014b 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -100,7 +100,7 @@ typedef float EmacsCGFloat; /* We override sendEvent: as a means to stop/start the event loop */ @interface EmacsApp : NSApplication { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#ifdef NS_IMPL_COCOA BOOL shouldKeepRunning; BOOL isFirst; #endif diff --git a/src/nsterm.m b/src/nsterm.m index 45c6214f0d0..190698db1fe 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4452,7 +4452,7 @@ ns_term_shutdown (int sig) { if (self = [super init]) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#ifdef NS_IMPL_COCOA self->isFirst = YES; #endif #ifdef NS_IMPL_GNUSTEP @@ -4463,9 +4463,19 @@ ns_term_shutdown (int sig) return self; } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#ifdef NS_IMPL_COCOA - (void)run { +#ifndef NSAppKitVersionNumber10_9 +#define NSAppKitVersionNumber10_9 1265 +#endif + + if ((int)NSAppKitVersionNumber != NSAppKitVersionNumber10_9) + { + [super run]; + return; + } + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (isFirst) [self finishLaunching]; @@ -4496,7 +4506,7 @@ ns_term_shutdown (int sig) // The file dialog still leaks 7k - 10k on 10.9 though. [super stop:sender]; } -#endif +#endif /* NS_IMPL_COCOA */ - (void)logNotification: (NSNotification *)notification {